﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text.RegularExpressions;
using Viki_IBll;
using Viki_Bll;
using Viki_IDal;
using Viki_DAL;
using Viki_Model;
using Viki_BllFactory;


namespace Viki1
{
    public partial class SiteMaster : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
           
           
            
        }

        protected void login_Click(object sender, EventArgs e)
        {
           

            IUserService us = Viki_BllFactory.DataAccess.CreateUserService();
            if (username.Text.Equals("") || password.Text.Equals(""))
                Response.Write("<script language='javascript'>alert('请输入用户名或者密码')</script>");
            else if (us.findUser(username.Text, password.Text))
                Session["username"] = username.Text;
             
            else
                Response.Write("<script language='javascript'>alert('用户名或者密码错误')</script>");
            
        }

       
    }
}
